blob: e2569536551c778f5b3dc425758f646eaa50d178 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
import { auth, get } from '$lib/utils';
import { redirect } from "@sveltejs/kit"
export let load = async ({ cookies, params }) => {
let { serial } = params;
let pot;
try {
pot = await get(`/pot/${serial}`, auth(cookies));
} catch (e) {
console.log(e);
}
if (pot) throw redirect(307, `/pot/${serial}`);
return params;
};
|